import Observer from "./Observer.js"

export default function observe(value) {
  //   if (
  //     Object.prototype.toString.call(value) === "[object Object]" ||
  //     Array.isArray(value)
  //   ) {
  //     return new Observer(value)
  //   }
  if (typeof value != "object") return
  var ob
  if (typeof value.__ob__ !== "undefined") {
    ob = value.__ob__
  } else {
    console.log("new Observer")
    ob = new Observer(value) //__ob__和别的属性名区分 Observer类中添加
  }
  return ob
}
